package com.jffccloud.auth.security;

import com.jffccloud.common.util.crypto.Cryptor;
import org.springframework.security.crypto.password.PasswordEncoder;

public class Md5PasswordEncoder implements PasswordEncoder {
    @Override
    public String encode(CharSequence charSequence) {
        return Cryptor.crypto(Cryptor.ENC_MD5, charSequence.toString());
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return Cryptor.crypto(Cryptor.ENC_MD5, charSequence.toString()).equals(s);
    }
}
